<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title></title>
  </head>
  <body>
    <div id="app">
      <div ref="div">我是一个div</div>
    </div>
    <script src="./vue.js"></script>
    <script>
      const vm = new Vue({
        el: '#app',
        created () {
          // this.$refs.div.style.color = 'red'
        },
        mounted () {
          // 模板渲染完毕
          this.$refs.div.style.color = 'red'
        },
      })
    </script>
  </body>
</html>